widget: Drop gtk_widget_destroy
authorMatthias Clasen <mclasen@redhat.com>
Sat, 9 May 2020 19:45:54 +0000 (15:45 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 11 May 2020 16:20:59 +0000 (12:20 -0400)
docs/reference/gtk/gtk4-sections.txt
gtk/gtkwidget.c
gtk/gtkwidget.h

index d03861889dd7785fcf088b1a6a2b0204e5ef55d8..9f1f4acbed3840247177a17c41121dee21061348 100644 (file)
@@ -3955,7 +3955,6 @@ GtkCallback
 GtkRequisition
 GtkAllocation
 gtk_widget_new
-gtk_widget_destroy
 gtk_widget_in_destruction
 gtk_widget_unparent
 gtk_widget_show
index fe1878340ed4b45933e1c83d86267e60db5397f6..ef06f6f4278eabd76815a43d20dd26caa01feabe 100644 (file)
@@ -2610,53 +2610,6 @@ gtk_widget_unparent (GtkWidget *widget)
   g_object_unref (widget);
 }
 
-/**
- * gtk_widget_destroy:
- * @widget: a #GtkWidget
- *
- * Destroys a widget.
- *
- * When a widget is destroyed all references it holds on other objects
- * will be released:
- *
- *  - if the widget is inside a container, it will be removed from its
- *  parent
- *  - if the widget is a container, all its children will be destroyed,
- *  recursively
- *  - if the widget is a top level, it will be removed from the list
- *  of top level widgets that GTK+ maintains internally
- *
- * It's expected that all references held on the widget will also
- * be released; you should connect to the #GtkWidget::destroy signal
- * if you hold a reference to @widget and you wish to remove it when
- * this function is called. It is not necessary to do so if you are
- * implementing a #GtkContainer, as you'll be able to use the
- * #GtkContainerClass.remove() virtual function for that.
- *
- * It's important to notice that gtk_widget_destroy() will only cause
- * the @widget to be finalized if no additional references, acquired
- * using g_object_ref(), are held on it. In case additional references
- * are in place, the @widget will be in an "inert" state after calling
- * this function; @widget will still point to valid memory, allowing you
- * to release the references you hold, but you may not query the widget's
- * own state.
- *
- * You should typically call this function on top level widgets, and
- * rarely on child widgets.
- *
- * See also: gtk_container_remove()
- */
-void
-gtk_widget_destroy (GtkWidget *widget)
-{
-  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  if (!priv->in_destruction)
-    g_object_run_dispose (G_OBJECT (widget));
-}
-
 static void
 gtk_widget_update_paintables (GtkWidget *widget)
 {
index 3aa805cd3d4420d4e9b6464257a1adbdda05d2c0..85f8bedb9c8ad09d2d95388968950b5e717b8dab 100644 (file)
@@ -300,8 +300,6 @@ GtkWidget* gtk_widget_new                 (GType                type,
                                            const gchar         *first_property_name,
                                            ...);
 GDK_AVAILABLE_IN_ALL
-void       gtk_widget_destroy             (GtkWidget           *widget);
-GDK_AVAILABLE_IN_ALL
 void       gtk_widget_unparent            (GtkWidget           *widget);
 GDK_AVAILABLE_IN_ALL
 void       gtk_widget_show                (GtkWidget           *widget);